// 将 数据 包裹到一个 Object 实例中

let x = Object() ;// new Object();
console.log( x , typeof x );

/* - - - 原始数据 - - - - - - - - - - - - - - - - - -*/

x = Object(null); // new Object( null );
console.log( x , typeof x );

x = Object(undefined) ; // new Object( undefined );
console.log( x , typeof x );

x = Object(NaN) ; // new Object( NaN );
console.log( x , typeof x );

x = Object(3.14); // new Object(3.14);
console.log( x , typeof x ); // [Number: 3.14] object

x = Object(true); // new Object(true);
console.log( x , typeof x ); // [Number: true] object

x = Object('kaifamiao'); // new Object('kaifamiao');
console.log( x , typeof x ); // [String: 'kaifamiao'] object

let p = BigInt( '0b100100110' );
console.log( p , typeof p );

x = Object(p);// new Object( p );
console.log( x , typeof x ); // [Bigint: 294n] object

const description = 'xiaomiao' ;
p = Symbol( description );
console.log( p , typeof p );

x = Object(p);// new Object( p );
console.log( x , typeof x ); // [Symbol: Symbol(xiaomiao)] object

console.log( '- '.repeat(20) );

/* - - - 对象 - - - - - - - - - - - - - - - - - - */

let array = [] ;
let y = Object(array); // new Object( array );
console.log( y , typeof y);
console.log( array === y );

console.log( '- '.repeat(20) );

let ins = { id: 1001 , name: '小姜' }
y = Object(ins); // new Object( ins );
console.log( y , typeof y);
console.log( ins === y );

console.log( '- '.repeat(20) );

let type = 'username' ;

let user = {
    // 使用 变量的值 在 对象字面量 中作属性名使用
    [type]: 'kaifamiao' ,
    password: 'hello'
}

// user[ type ] = 'kaifamiao';

console.log( user );
